<?php
date_default_timezone_set('PRC');

$params = ['content-type' => 'unknown'];
if ($_SERVER['CONTENT_TYPE'] === 'application/json') {
    $postdata = file_get_contents("php://input");
    $params = json_decode($postdata,true);
}
if ($_SERVER['CONTENT_TYPE'] === 'application/x-www-form-urlencoded' || $_SERVER['CONTENT_TYPE'] === 'multipart/form-data' ) {
    $params = $_POST;
}
//sleep(1);
echo json_encode($params);

function p($data) {
    echo '<pre>';
    print_r($data);
    echo '</pre>';
}